Background
The desire it to have a service that can characterize a DataStream from an instrument. This would allow for easier monitoring of instruments on the network.
| Parameter |
Description |
Options |
Default Value |
Required |
| Device ID |
The SSDS ID of the device that the user wants information about |
Any SSDS ID |
N/A |
Y |
| Number Of Samples To Average |
The number of samples back that the service is to use to calculate the average sampling interval |
Any Number |
10 |
N |
| Check for gaps |
Is a flag that tells the service to try to find data gaps based on some average sample interval |
True/False |
False |
N |
| Gap Interval |
Is the number of milliseconds to use as the sampling interval to search for gaps. If this is specified it will override the average gap calculated by the service |
Any number of milliseconds |
N/A |
N |
The Interface
The things that the user would want to know are:
| Return |
Parameters |
| Date and time of last packet received |
- Device ID
- RecordType to search for (nothing/default means most recent packet)
|
| Total Number Of Records |
- Device ID
- RecordType to search for (nothing/default specified means all packets)
|
| Data Gaps |
- Device ID
- RecordType
- Time window over data to search for gaps
- Gap criteria
- Type of gap
- Time only
- Sequence number only
- Time and sequence number
- Ways to specify gap
- Margin on gap in milliseconds (anything longer than gap + margin will be considered a possible gap)
- Let service calculate gap constraints (calculate average time between sample)
- Number of points to use (points back from most recent packet)
- Or time window to use (start to end time)
- Specify gap constraints
|
So the API interface looks like:
public final static String TIME_ONLY_GAP = "timeGap";
public final static String SEQ_ONLY_GAP = "seqGap";
public final static String TIME_SEQ_GAP = "timeSeqGap";
public final static String SERVICE_CALCULATED = "serviceCalculated";
public final static String USER_SPECIFIED = "userSpecified";
getDataStreamProperties(
Long deviceID, Long recordType, Boolean checkForGaps, Date startGapCheckWindow, Date endGapCheckWindow, String typeOfGap, Long marginMillis, String gapSpec, Long numberOfRecords, Date intervalCalcStartWindow, Date intervalCalcEndWindow, Long gapInMillis )
With a return that has the format of:
Properties Objects with properties:
| Property Name |
Value |
| lastPacketDateTime |
This is the date and time of the last packet received |
| totalNumberOfRecords |
This is the total number of records for the parameters specified |
| numberOfFuturePackets |
This is the number of packet that appear in the future. This should be zero and if they are not, there could be bad data |
| averagSampleIntervalInMillis |
This is the number of milliseconds that the service used to find data gaps |
| marginInMillis |
This is the number of milliseconds as a margin that the service used to find data gaps |
| numRecordsSearchedForGaps |
This is the number of records that were searched through while trying to find gaps using the gap criteria |
| dataGap1Start |
This is the date and time of start of the first possible gap in the data |
| dataGap1End |
This is the date and time of end of the first possible gap in the data |
| . |
. |
| . |
. |
| . |
. |
| dataGapNStart |
This is the date and time of start of the Nth possible gap in the data |
| dataGapNEnd |
This is the date and time of end of the Nth possible gap in the data |
Java EJB client
Under construction
REST client
If you want to use the REST-style interface the HTTP call would looks something like:
http:&p1Type=Long&p1Value=1300
&p2Type=Long&p2Value=1
&p3Type=Boolean&p3Value=true
&p4Type=Date&p4Value=2008-12-00T00:00:00Z
&p5Type=Date&p5Value=2008-01-00T00:00:00Z
&p6Type=String&p6Value=timeGap
&p7Type=Long&p7Value=5000
&p8Type=String&p8Value=userSpecified
&p9Type=Long&p9Value=10
&p10Type=Date&p10Value=
&p11Type=Date&p11Value=
&p12Type=Long&p12Value=10000
And the return might look something like
Web Service Client
Under construction